<template>
  <!-- 访客记录-详情 -->
  <div>
    <public-modal
      width="1000px"
      :footer="false"
      title="选择绑定人员"
      modalStyle="detailModal"
      :publicVisible="publicVisible"
      cancelContext="拒绝"
      confirmContext="通过"
      @handleOk="handleOk"
      @cancel="cancel"
    >
      <div slot="content">
        <div class="search-group">
          <div class="input-wrap">
            <div class="label">人员姓名:</div>
            <div class="input-item">
              <a-input allowClear :maxLength="30" clearable v-model="queryParam.companyName" placeholder="请填写" />
            </div>
          </div>

          <div class="input-wrap">
            <div class="label">身份证号:</div>
            <div class="input-item">
              <a-input allowClear :maxLength="30" clearable v-model="queryParam.companyName" placeholder="请填写" />
            </div>
          </div>

          <div class="btn-wrap">
            <a-button class="searchBtn" @click="searchQuery()" type="primary"> 搜索 </a-button>
            <a-button class="resetBtn" @click="searchReset()" type="primary"> 重置 </a-button>
          </div>
        </div>
        <a-table
          rowKey="id"
          class="tableList"
          :columns="columns"
          :dataSource="dataSource"
          :pagination="ipagination"
          style="margin: 20px 0; border: 1px solid #154b81"
        >
          <template slot="action" slot-scope="records">
            <span class="operation deatil-color" @click="handleBind(records)">绑定</span>
          </template>
        </a-table>
      </div>
      <div slot="footer"></div>
    </public-modal>
  </div>
</template>
<script>
import startEndTime from '@/components/startEndTime'
import publicModal from '@/components/publicModal'
import { JeecgListMixinNew } from '@/mixins/JeecgListMixinNew'
import { houseDetails } from '@/api/api'
import { webpopulationDetails } from '@/api/api'
import { previewImage } from '@/utils/util'

export default {
  name: 'actuallyDetail',
  components: { publicModal, startEndTime },
  mixins: [JeecgListMixinNew],
  data() {
    return {
      url: {
        list: '/wb/mentalpatient/page',
      },
      publicVisible: false,
      columns: [
        {
          title: '序号',
          align: 'center',
          width: 100,
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '姓名',
          align: 'center',
          dataIndex: 'fHjdzQhnxxdz',
        },
        {
          title: '身份证号',
          align: 'center',
          dataIndex: 'fYfzgx',
          ellipsis: true,
        },
        {
          title: '负责医疗机构',
          align: 'center',
          dataIndex: 'policeAgencyName',
          ellipsis: true,
        },
        {
          title: '操作',
          scopedSlots: { customRender: 'action' },
          ellipsis: true,
          align: 'center',
          width: 200,
          fixed: 'right',
        },
      ],
      project_company_type: [],
      queryParams: {},
      disableMixinCreated: true,
      populationBean: {},
    }
  },

  methods: {
    handlePreviewFace(urls) {
      previewImage.call(this, urls)
    },
    async show(records) {
      this.publicVisible = true
      this.getDetail(records)
    },
    getDetail(records) {
      const params = {
        id: records.id,
      }
      webpopulationDetails(params).then((res) => {
        if (res.code == 200) {
          const { populationBean, retingHouseBean } = res.result
          this.populationBean = populationBean
          this.retingHouseBean = retingHouseBean
        } else {
        }
      })
    },
    handleOk() {
      this.publicVisible = false
    },

    cancel(target) {
      this.publicVisible = false
    },
    handleBind() {},
  },
}
</script>
<style scoped lang="less">
/deep/ .modalCotent {
  padding: 20px 40px;
  border-radius: 0 0 4px 4px;
}
</style>
